home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1984 October
/
1984-10.d64
/
quiz master 2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
108 lines
10 rem student quiz generator
20 print"[147]":clr:poke53280,16:poke53281,16:poke808,225:poke649,0:s=54727
30 dimq$(100),a$(100),b$(100),c$(100),d$(100),e$(100),m$(15),a(100)
40 gosub840:print"[147]":printspc(12)" [204][207][193][196][201][206][199][160][196][193][212][193][160][160][160]":print"[144]":gosub390:print""
50 forx=1toa:printx". "m$(x):next
60 print"[197]nter number of test":poke649,10:inputx
70 ifx<1orx>athenprint"invalid range":goto60
80 n$=m$(x):poke649,0:open15,8,15:print"[147]":open2,8,2,+n$+" file,s,r"
90 print" [204][207][193][196][201][206][199][160]";n$;" [209][213][201][218]":print"[144]"
100 x=0
110 x=x+1
120 input#2,q$(x):input#2,a$(x):input#2,b$(x):input#2,c$(x):input#2,d$(x):input#2,e$(x)
130 ifst and64then150
140 goto110
150 close2:poke198,0:l=x:close15:gosub920:print"[147]"
160 rem test routine
170 y=1:poke649,10:gosub540
180 forn=1tol-1:print"[147]":printtab(20-len(n$)/2);n$
190 s$=str$(n)+". "+q$(a(n)):print:gosub450
200 rem answer choices
210 s$=a$(a(n)):gosub450:s$=b$(a(n)):gosub450:s$=c$(a(n)):gosub450
220 s$=d$(a(n)):gosub450:s$=e$(a(n))
230 print"[197]nter letter of most correct answer:":poke198,0
240 inputf$
250 iflen(f$)<>1thenprint"[197]nter one letter only":goto240
260 ifasc(f$)<65orasc(f$)>68thenprint"[193]nswer must be [193],[194],[195], or [196]":goto240
270 ifasc(f$)=asc(s$)thenp=p+1
280 ifasc(f$)=asc(s$)thenprintspc(9)" [193]nswer is correct!! ":gosub1030
290 ifasc(f$)<>asc(s$)then:gosub1060:gosub820
300 fort=1to4000:next:next
310 n=n-1
320 s=int(p/n*100+.5):print"[147][217]ou scored ";s;" %"
330 ifs>80ands<90thenprint"[211]tudy this section again"
340 ifs>90ands<100thenprint"[214]ery good, but more study would help"
350 ifs=100thenprint"[197]xcellent!! [208]erfect score!!"
360 fort=1to3000:next
370 print"[197]nter [210][213][206] to re-start program":poke808,237:end
380 rem print justify
390 open15,8,15:open3,8,3,"test titles,s,r":print"[144]"
400 x=x+1
410 input#3,m$(x)
420 ifstatusand64then440
430 goto400
440 close3:poke198,0:a=x:close15:print"[147]":return
450 iflen(s$)<40thenprints$:goto510
460 x=40:y=1
470 x=x-1
480 ifasc(mid$(s$,x,y)+chr$(0))<>32then470
490 printleft$(s$,x)
500 z=len(s$):z=z-x:printright$(s$,z)
510 return
520 print:printspc(14)"test titles":print:fora=1tox:printa;". ";m$(a):next:return
530 rem disable cursor controls
540 ifpeek(830)=133then560
550 fori=828to977:reada:pokei,a:next
560 sys828:return
570 data169,000,133,252,169,080
580 data133,251,169,164,133,002
590 data169,083,141,036,003,169
600 data003,141,037,003,096,152
610 data072,138,072,165,252,208
620 data007,032,116,003,169,000
630 data133,253,166,253,189,000
640 data002,133,254,198,252,230
650 data253,104,170,104,168,165
660 data254,096,160,000,132,252
670 data165,002,032,210,255,169
680 data157,032,210,255,032,228
690 data255,240,251,164,252,133
700 data254,169,032,032,210,255
710 data169,157,032,210,255,165
720 data254,201,013,240,043,201
730 data020,208,013,192,000,240
740 data211,136,169,157,032,210
750 data255,076,118,003,041,127
760 data201,032,144,196,196,251
770 data240,192,165,254,153,000
780 data002,032,210,255,169,000
790 data133,212,200,076,118,003
800 data230,252,153,000,002,169
810 data032,032,210,255,096,013
820 printspc(10)" [211]orry answer is wrong "
830 print"[195]orrect choice is: ";s$:return
840 print"[147]":printspc(13)" [209]uiz [205]aster ":poke53272,23
850 print" [212]hese tests are multiple choice."
860 print"[197]nter the best answer from the choices"
870 print"given."
880 print" [197]nter the number of the test you "
890 print"have been assigned when the program "
900 print"calls for it."
910 fort=1to6000:next:return
920 rem random gen.
930 print"[147][215][193][201][212]-- [208]reparing [209]uiz":print"[144]"
940 forx=1tol
950 a(x)=int(rnd(.)*l)+1
960 ifx=1then1000
970 fory=1tox-1
980 ifa(y)=a(x)then950
990 nexty
1000 nextx
1010 print"":return
1020 rem correct answer sound
1030 s=54272:pokes,150:pokes+1,100:pokes+5,0:pokes+6,240:pokes+24,15:pokes+4,17
1040 fort=0to200:next:pokes+4,0:return
1050 rem wrong answer sound
1060 s=54272:pokes,150:pokes+1,5:pokes+5,0:pokes+6,240:pokes+24,15:pokes+4,17
1070 fort=0to200:next:pokes+4,0:return